package com.qtenv.datasync.service.entity.msmapper;


import com.qtenv.datasync.service.entity.TerminalHistoryData;
import com.qtenv.datasync.service.entity.shanke.ShanKeHistoryData;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

@org.mapstruct.Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface ShanKeTerminalHistoryHMapper {
    ShanKeTerminalHistoryHMapper INSTANCE = Mappers.getMapper(ShanKeTerminalHistoryHMapper.class);

    @Mappings({
            @Mapping(source = "shanKeHistoryData.commAddr", target = "terminalID"),
            @Mapping(source = "shanKeHistoryData.data", target = "totalFlow"),
            @Mapping(source = "shanKeHistoryData.readTimeDate", target = "readDate"),
    })
    TerminalHistoryData toTerminalHistoryData(String tenantId, ShanKeHistoryData shanKeHistoryData);
}
